#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue> 
//#define int unsigned long long
#define int long long
#define all(x) x.begin(), x.end()
using namespace std;

void solve()
{
	int n, ans = 0; cin >> n;
	vector<int> arr(n); for (auto& e : arr) cin >> e;
	sort(all(arr));
	for (int i = 0; i < n; i += 2)
		ans = max(ans, arr[i + 1] - arr[i]);
	cout << ans << endl;
}

signed main()
{
	int t; cin >> t;
	while (t--) solve();
	return 0;
}

//5 2 1 2 4 10 1 2 9 6 3 8 9 3 3 2 8 5 5 5 5 5 5 5 5 4 -5 -1 2 6
